<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>dev: dev::net::Socket Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">dev
   &#160;<span id="projectnumber">0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classdev_1_1net_1_1_socket.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classdev_1_1net_1_1_socket-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">dev::net::Socket Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>套接字  
 <a href="classdev_1_1net_1_1_socket.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_socket_8hpp_source.html">Socket.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7fa4fc9a046e73a5f8c1a20cb284e36e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7fa4fc9a046e73a5f8c1a20cb284e36e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Socket</b> (int domain, int type, int protocol=0)</td></tr>
<tr class="separator:a7fa4fc9a046e73a5f8c1a20cb284e36e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40070074dfd48f04536bd0a027166293"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40070074dfd48f04536bd0a027166293"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Socket</b> (sock_t sockfd)</td></tr>
<tr class="separator:a40070074dfd48f04536bd0a027166293"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba630380ca8cde22e22a16ddcb4670ae"><td class="memItemLeft" align="right" valign="top">sock_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#aba630380ca8cde22e22a16ddcb4670ae">getSocket</a> () const </td></tr>
<tr class="memdesc:aba630380ca8cde22e22a16ddcb4670ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取本地套接字  <a href="#aba630380ca8cde22e22a16ddcb4670ae">More...</a><br /></td></tr>
<tr class="separator:aba630380ca8cde22e22a16ddcb4670ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4a310b0db236a8d55f2936373d36f5a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#ab4a310b0db236a8d55f2936373d36f5a">isValid</a> (void) const </td></tr>
<tr class="memdesc:ab4a310b0db236a8d55f2936373d36f5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断套接字是否有效  <a href="#ab4a310b0db236a8d55f2936373d36f5a">More...</a><br /></td></tr>
<tr class="separator:ab4a310b0db236a8d55f2936373d36f5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6b109f9f6d599f65edf379866e3fe0b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#ad6b109f9f6d599f65edf379866e3fe0b">setNonBlocking</a> (bool on=true)</td></tr>
<tr class="memdesc:ad6b109f9f6d599f65edf379866e3fe0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字阻塞状态  <a href="#ad6b109f9f6d599f65edf379866e3fe0b">More...</a><br /></td></tr>
<tr class="separator:ad6b109f9f6d599f65edf379866e3fe0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7acfefe85faea54804509eac0e082900"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a7acfefe85faea54804509eac0e082900">setReuseAddr</a> (bool on=false)</td></tr>
<tr class="memdesc:a7acfefe85faea54804509eac0e082900"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字阻塞是否重用地址  <a href="#a7acfefe85faea54804509eac0e082900">More...</a><br /></td></tr>
<tr class="separator:a7acfefe85faea54804509eac0e082900"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaddc13c0968b0652436155f8bd5c0daa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#aaddc13c0968b0652436155f8bd5c0daa">setLinger</a> (bool on=false)</td></tr>
<tr class="memdesc:aaddc13c0968b0652436155f8bd5c0daa"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置套接字linger状态  <a href="#aaddc13c0968b0652436155f8bd5c0daa">More...</a><br /></td></tr>
<tr class="separator:aaddc13c0968b0652436155f8bd5c0daa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adee8179a6f2d53861eeb13b398901845"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#adee8179a6f2d53861eeb13b398901845">reset</a> (sock_t sock)</td></tr>
<tr class="memdesc:adee8179a6f2d53861eeb13b398901845"><td class="mdescLeft">&#160;</td><td class="mdescRight">重置内部原始本地套接字  <a href="#adee8179a6f2d53861eeb13b398901845">More...</a><br /></td></tr>
<tr class="separator:adee8179a6f2d53861eeb13b398901845"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af86b037ac9f6b916c8bc7b174a061297"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#af86b037ac9f6b916c8bc7b174a061297">getUserDataPtr</a> ()</td></tr>
<tr class="memdesc:af86b037ac9f6b916c8bc7b174a061297"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取用户数据  <a href="#af86b037ac9f6b916c8bc7b174a061297">More...</a><br /></td></tr>
<tr class="separator:af86b037ac9f6b916c8bc7b174a061297"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3888df2959501c6d40d021ddc3a47eaf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a3888df2959501c6d40d021ddc3a47eaf">getUserDataInt</a> ()</td></tr>
<tr class="memdesc:a3888df2959501c6d40d021ddc3a47eaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取用户数据  <a href="#a3888df2959501c6d40d021ddc3a47eaf">More...</a><br /></td></tr>
<tr class="separator:a3888df2959501c6d40d021ddc3a47eaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8526950530c1f58529af1e8f3d225ede"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a8526950530c1f58529af1e8f3d225ede">getUserDataLong</a> ()</td></tr>
<tr class="memdesc:a8526950530c1f58529af1e8f3d225ede"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取用户数据  <a href="#a8526950530c1f58529af1e8f3d225ede">More...</a><br /></td></tr>
<tr class="separator:a8526950530c1f58529af1e8f3d225ede"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09404a9a214270685b3f76addf02cd2c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a09404a9a214270685b3f76addf02cd2c">setUserDataPtr</a> (void *pV)</td></tr>
<tr class="memdesc:a09404a9a214270685b3f76addf02cd2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置用户数据  <a href="#a09404a9a214270685b3f76addf02cd2c">More...</a><br /></td></tr>
<tr class="separator:a09404a9a214270685b3f76addf02cd2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d666eda7b16aceca6feebc6151b2355"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a1d666eda7b16aceca6feebc6151b2355">setUserDataInt</a> (int x)</td></tr>
<tr class="memdesc:a1d666eda7b16aceca6feebc6151b2355"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置用户数据  <a href="#a1d666eda7b16aceca6feebc6151b2355">More...</a><br /></td></tr>
<tr class="separator:a1d666eda7b16aceca6feebc6151b2355"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bcb192e9d5da628370c89e357a0103f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a5bcb192e9d5da628370c89e357a0103f">setUserDataLong</a> (long x)</td></tr>
<tr class="memdesc:a5bcb192e9d5da628370c89e357a0103f"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置用户数据  <a href="#a5bcb192e9d5da628370c89e357a0103f">More...</a><br /></td></tr>
<tr class="separator:a5bcb192e9d5da628370c89e357a0103f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25675e062ae83762dd1e25ef745f6ba1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#a25675e062ae83762dd1e25ef745f6ba1">receive</a> (char *buff, size_t length, int flags=0)</td></tr>
<tr class="memdesc:a25675e062ae83762dd1e25ef745f6ba1"><td class="mdescLeft">&#160;</td><td class="mdescRight">接收数据  <a href="#a25675e062ae83762dd1e25ef745f6ba1">More...</a><br /></td></tr>
<tr class="separator:a25675e062ae83762dd1e25ef745f6ba1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2218f65624a640161009ddd0bfa509e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#af2218f65624a640161009ddd0bfa509e">send</a> (const char *buff, size_t length, int flags=0)</td></tr>
<tr class="memdesc:af2218f65624a640161009ddd0bfa509e"><td class="mdescLeft">&#160;</td><td class="mdescRight">发送数据  <a href="#af2218f65624a640161009ddd0bfa509e">More...</a><br /></td></tr>
<tr class="separator:af2218f65624a640161009ddd0bfa509e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf71d50699036a8a69cb362a9ac7ad02"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf71d50699036a8a69cb362a9ac7ad02"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_socket.html#abf71d50699036a8a69cb362a9ac7ad02">close</a> (void)</td></tr>
<tr class="memdesc:abf71d50699036a8a69cb362a9ac7ad02"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭套接字 <br /></td></tr>
<tr class="separator:abf71d50699036a8a69cb362a9ac7ad02"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a43fe1eaa6c6b4d4ecbb2ba361d312b66"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a43fe1eaa6c6b4d4ecbb2ba361d312b66"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>TcpConnection</b></td></tr>
<tr class="separator:a43fe1eaa6c6b4d4ecbb2ba361d312b66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a810e9e3048210a2e29dbd5cdd6f5812d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a810e9e3048210a2e29dbd5cdd6f5812d"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>TcpAcceptor</b></td></tr>
<tr class="separator:a810e9e3048210a2e29dbd5cdd6f5812d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>套接字 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aba630380ca8cde22e22a16ddcb4670ae"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sock_t dev::net::Socket::getSocket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取本地套接字 </p>
<dl class="section return"><dt>Returns</dt><dd>sock_t </dd></dl>

</div>
</div>
<a class="anchor" id="a3888df2959501c6d40d021ddc3a47eaf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int dev::net::Socket::getUserDataInt </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取用户数据 </p>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a class="anchor" id="a8526950530c1f58529af1e8f3d225ede"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">long dev::net::Socket::getUserDataLong </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取用户数据 </p>
<dl class="section return"><dt>Returns</dt><dd>long </dd></dl>

</div>
</div>
<a class="anchor" id="af86b037ac9f6b916c8bc7b174a061297"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void* dev::net::Socket::getUserDataPtr </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取用户数据 </p>
<dl class="section return"><dt>Returns</dt><dd>void* </dd></dl>

</div>
</div>
<a class="anchor" id="ab4a310b0db236a8d55f2936373d36f5a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool dev::net::Socket::isValid </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断套接字是否有效 </p>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="a25675e062ae83762dd1e25ef745f6ba1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket::receive </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>接收数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buff</td><td>数据缓存 </td></tr>
    <tr><td class="paramname">length</td><td>数据缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回接收的数据长度，如果套接字非阻塞且数据 已接收完返回SOCKET_ERROR_WOULDBLOCK，错误返回SOCKET_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="adee8179a6f2d53861eeb13b398901845"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Socket::reset </td>
          <td>(</td>
          <td class="paramtype">sock_t&#160;</td>
          <td class="paramname"><em>sock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>重置内部原始本地套接字 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af2218f65624a640161009ddd0bfa509e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket::send </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>发送数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buff</td><td>数据缓存 </td></tr>
    <tr><td class="paramname">length</td><td>数据缓存长度 </td></tr>
    <tr><td class="paramname">flags</td><td>标志 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功发送接收的数据长度，如果套接字非阻塞且数据 发送缓存已满返回SOCKET_ERROR_WOULDBLOCK，错误返回SOCKET_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="aaddc13c0968b0652436155f8bd5c0daa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::setLinger </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>on</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置套接字linger状态 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">on</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="ad6b109f9f6d599f65edf379866e3fe0b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::setNonBlocking </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>on</em> = <code>true</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置套接字阻塞状态 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">on</td><td>是否阻塞 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="a7acfefe85faea54804509eac0e082900"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::setReuseAddr </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>on</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置套接字阻塞是否重用地址 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">on</td><td>是否重用地址 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="a1d666eda7b16aceca6feebc6151b2355"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void dev::net::Socket::setUserDataInt </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置用户数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">int</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5bcb192e9d5da628370c89e357a0103f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void dev::net::Socket::setUserDataLong </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置用户数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">long</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a09404a9a214270685b3f76addf02cd2c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void dev::net::Socket::setUserDataPtr </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>pV</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置用户数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">void*</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>dev/dev/net/<a class="el" href="_socket_8hpp_source.html">Socket.hpp</a></li>
<li>dev/src/net/Socket.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>dev</b></li><li class="navelem"><b>net</b></li><li class="navelem"><a class="el" href="classdev_1_1net_1_1_socket.html">Socket</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
